#ifndef __LOGGER_H__
#define __LOGGER_H__

#include <LoggingGlobal.h>

#include <map>
#include <string>
#include <vector>

namespace logging
{
    // Forward Declarations
    class IHandler;

    class Logger
	{
	public:
	    static Logger * getLogger( const std::string & name );

	    void log( LogLevel 		logLevel, 
		      const std::string & 	message,
		      const std::string & 	sourceFileName 		= std::string(),
		      const std::string & 	sourceClassName 	= std::string(),
		      const std::string & 	sourceMethodName 	= std::string(),
		      int 			sourceFileLine 		= -1
		      );


	    void finest( const std::string & message );
	    void finer( const std::string & message );
	    void fine( const std::string & message );

	    void config( const std::string & message );
	    void info( const std::string & message );
	    void warning( const std::string & message );

	    void severe( const std::string & message );

	    // IHandler Management
	    void addHandler( IHandler * handler );
	    void removeHandler( IHandler * handler );
	    bool hasHandler( IHandler * handler );
	protected:
	    LogLevel m_logLevel;
	    std::string m_name;

	    std::vector<IHandler*> m_vHandlers;

	    Logger( const std::string & name = std::string(), 
		    LogLevel logLevel = Finest );

	   static std::map<std::string, Logger*> m_loggerRegistry; 		     
	};
}	
#endif // __LOGGER_H__
